﻿using DataTransfer.SDK.Models;
using Microsoft.Extensions.Configuration;

namespace DataTransfer.Core.Configurations
{
    public class ExcelExportSheetSetting
    {
        const string SHEET_NAME = "sheetName";
        const string QUERY_NAME = "queryName";
        const string HEADER_ROW_INDEX = "headerRowIndex";
        const string SKIP_ROW_COUNT = "skipRowCount";
        const string SKIP_COLUMN_COUNT = "skipColumnCount";
        const string HEADER_HEIGHT = "headerHeight";
        const string ROW_HEIGHT = "rowHeight";
        const string BORDERED = "bordered";
        const string FIELDS = "fields";

        internal const short DEFAULT_HEADER_HEIGHT = 300;
        internal const short DEFAULT_ROW_HEIGHT = 300;
        internal const int DEFAULT_HEADER_ROW_INDEX = 0;
        internal const int DEFAULT_SKIP = 0;

        /// <summary>
        /// 表名称
        /// </summary>
        [ConfigurationKeyName(SHEET_NAME)]
        public string SheetName
        {
            get;
            set;
        }
        /// <summary>
        /// 数据查询名称
        /// </summary>
        [ConfigurationKeyName(QUERY_NAME)]
        public string QueryName
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName(HEADER_ROW_INDEX)]
        public int HeaderRowIndex
        {
            get;
            set;
        } = DEFAULT_HEADER_ROW_INDEX;
        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName(SKIP_ROW_COUNT)]
        public int SkipRowCount
        {
            get;
            set;
        } = DEFAULT_SKIP;
        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName(SKIP_COLUMN_COUNT)]
        public int SkipColumnCount
        {
            get;
            set;
        } = DEFAULT_SKIP;
        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName(FIELDS)]
        public ExcelExportSheetFieldSettingCollection Fields
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName(HEADER_HEIGHT)]
        public short HeaderHeight
        {
            get;
            set;
        } = DEFAULT_HEADER_HEIGHT;
        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName(ROW_HEIGHT)]
        public short RowHeight
        {
            get;
            set;
        } = DEFAULT_ROW_HEIGHT;

        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName(BORDERED)]
        public bool Bordered
        {
            get;
            set;
        }
    }
}